package com.bjwl.service.impl;

import com.bjwl.dao.SettlementMapper;
import com.bjwl.pojo.CardStrip;
import com.bjwl.pojo.Orders;
import com.bjwl.pojo.Settlement;
import com.bjwl.service.CardStripService;
import com.bjwl.service.SettlementService;
import com.bjwl.utils.PageBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: czc
 * @Date:Create：in 2020/5/11 20:47
 * @Description:
 * @Modified By：
 * @Version: 1.0
 */
@Service
public class SettlementServiceImpl implements SettlementService {

    @Autowired
    private SettlementMapper settlementMapper;

    @Autowired
    private CardStripService cardStripService;


    @Override
    public List<Settlement> findAllSettlementByBsid(Integer bsid) {
        return settlementMapper.findAllSettlementByBsid(bsid);
    }

    @Override
    public Settlement jumpUpdateSettle(Integer id) {
        return settlementMapper.jumpUpdateSettle(id);
    }

    @Override
    public void updateSettlement(Settlement settlement) {
        settlementMapper.updateSettlement(settlement);
    }

    @Override
    public PageBean<Settlement> findAllSettlement(Integer pageNum, Integer bsid, String wstarttime, String wendtime, String settlestate, Integer membershipcard) {
        PageBean<Settlement> pageBean = new PageBean<Settlement>(pageNum,10,settlementMapper.serrlementPaging(bsid,wstarttime,wendtime,settlestate,membershipcard));
        pageBean.setData(settlementMapper.findAllSettlement(pageBean,bsid,wstarttime,wendtime,settlestate,membershipcard));
        return pageBean;
    }

    @Override
    public Settlement findSettlementByCardid(Integer membershipcard) {
        return settlementMapper.findSettlementByCardid(membershipcard);
    }


}
